Integrand size = 23, antiderivative size = 151 \[ \int (a+a \sec (c+d x))^4 (A+B \sec (c+d x)) \, dx=a^4 A x+\frac {a^4 (48 A+35 B) \text {arctanh}(\sin (c+d x))}{8 d}+\frac {5 a^4 (8 A+7 B) \tan (c+d x)}{8 d}+\frac {a B (a+a \sec (c+d x))^3 \tan (c+d x)}{4 d}+\frac {(4 A+7 B) \left (a^2+a^2 \sec (c+d x)\right )^2 \tan (c+d x)}{12 d}+\frac {(32 A+35 B) \left (a^4+a^4 \sec (c+d x)\right ) \tan (c+d x)}{24 d} \]
a^4*A*x+1/8*a^4*(48*A+35*B)*arctanh(sin(d*x+c))/d+5/8*a^4*(8*A+7*B)*tan(d* x+c)/d+1/4*a*B*(a+a*sec(d*x+c))^3*tan(d*x+c)/d+1/12*(4*A+7*B)*(a^2+a^2*sec (d*x+c))^2*tan(d*x+c)/d+1/24*(32*A+35*B)*(a^4+a^4*sec(d*x+c))*tan(d*x+c)/d
Time = 4.73 (sec) , antiderivative size = 178, normalized size of antiderivative = 1.18 \[ \int (a+a \sec (c+d x))^4 (A+B \sec (c+d x)) \, dx=a^4 A x+\frac {6 a^4 A \text {arctanh}(\sin (c+d x))}{d}+\frac {35 a^4 B \text {arctanh}(\sin (c+d x))}{8 d}+\frac {7 a^4 A \tan (c+d x)}{d}+\frac {8 a^4 B \tan (c+d x)}{d}+\frac {2 a^4 A \sec (c+d x) \tan (c+d x)}{d}+\frac {27 a^4 B \sec (c+d x) \tan (c+d x)}{8 d}+\frac {a^4 B \sec ^3(c+d x) \tan (c+d x)}{4 d}+\frac {a^4 A \tan ^3(c+d x)}{3 d}+\frac {4 a^4 B \tan ^3(c+d x)}{3 d} \]
a^4*A*x + (6*a^4*A*ArcTanh[Sin[c + d*x]])/d + (35*a^4*B*ArcTanh[Sin[c + d* x]])/(8*d) + (7*a^4*A*Tan[c + d*x])/d + (8*a^4*B*Tan[c + d*x])/d + (2*a^4* A*Sec[c + d*x]*Tan[c + d*x])/d + (27*a^4*B*Sec[c + d*x]*Tan[c + d*x])/(8*d ) + (a^4*B*Sec[c + d*x]^3*Tan[c + d*x])/(4*d) + (a^4*A*Tan[c + d*x]^3)/(3* d) + (4*a^4*B*Tan[c + d*x]^3)/(3*d)
Time = 0.92 (sec) , antiderivative size = 162, normalized size of antiderivative = 1.07, number of steps used = 14, number of rules used = 13, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.565, Rules used = {3042, 4405, 3042, 4405, 3042, 4405, 27, 3042, 4402, 3042, 4254, 24, 4257}
Below are the steps used by Rubi to obtain the solution. The rule number used for the transformation is given above next to the arrow. The rules definitions used are listed below.
\(\displaystyle \int (a \sec (c+d x)+a)^4 (A+B \sec (c+d x)) \, dx\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \int \left (a \csc \left (c+d x+\frac {\pi }{2}\right )+a\right )^4 \left (A+B \csc \left (c+d x+\frac {\pi }{2}\right )\right )dx\) |
\(\Big \downarrow \) 4405 |
\(\displaystyle \frac {1}{4} \int (\sec (c+d x) a+a)^3 (4 a A+a (4 A+7 B) \sec (c+d x))dx+\frac {a B \tan (c+d x) (a \sec (c+d x)+a)^3}{4 d}\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \frac {1}{4} \int \left (\csc \left (c+d x+\frac {\pi }{2}\right ) a+a\right )^3 \left (4 a A+a (4 A+7 B) \csc \left (c+d x+\frac {\pi }{2}\right )\right )dx+\frac {a B \tan (c+d x) (a \sec (c+d x)+a)^3}{4 d}\) |
\(\Big \downarrow \) 4405 |
\(\displaystyle \frac {1}{4} \left (\frac {1}{3} \int (\sec (c+d x) a+a)^2 \left (12 A a^2+(32 A+35 B) \sec (c+d x) a^2\right )dx+\frac {(4 A+7 B) \tan (c+d x) \left (a^2 \sec (c+d x)+a^2\right )^2}{3 d}\right )+\frac {a B \tan (c+d x) (a \sec (c+d x)+a)^3}{4 d}\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \frac {1}{4} \left (\frac {1}{3} \int \left (\csc \left (c+d x+\frac {\pi }{2}\right ) a+a\right )^2 \left (12 A a^2+(32 A+35 B) \csc \left (c+d x+\frac {\pi }{2}\right ) a^2\right )dx+\frac {(4 A+7 B) \tan (c+d x) \left (a^2 \sec (c+d x)+a^2\right )^2}{3 d}\right )+\frac {a B \tan (c+d x) (a \sec (c+d x)+a)^3}{4 d}\) |
\(\Big \downarrow \) 4405 |
\(\displaystyle \frac {1}{4} \left (\frac {1}{3} \left (\frac {1}{2} \int 3 (\sec (c+d x) a+a) \left (8 A a^3+5 (8 A+7 B) \sec (c+d x) a^3\right )dx+\frac {(32 A+35 B) \tan (c+d x) \left (a^4 \sec (c+d x)+a^4\right )}{2 d}\right )+\frac {(4 A+7 B) \tan (c+d x) \left (a^2 \sec (c+d x)+a^2\right )^2}{3 d}\right )+\frac {a B \tan (c+d x) (a \sec (c+d x)+a)^3}{4 d}\) |
\(\Big \downarrow \) 27 |
\(\displaystyle \frac {1}{4} \left (\frac {1}{3} \left (\frac {3}{2} \int (\sec (c+d x) a+a) \left (8 A a^3+5 (8 A+7 B) \sec (c+d x) a^3\right )dx+\frac {(32 A+35 B) \tan (c+d x) \left (a^4 \sec (c+d x)+a^4\right )}{2 d}\right )+\frac {(4 A+7 B) \tan (c+d x) \left (a^2 \sec (c+d x)+a^2\right )^2}{3 d}\right )+\frac {a B \tan (c+d x) (a \sec (c+d x)+a)^3}{4 d}\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \frac {1}{4} \left (\frac {1}{3} \left (\frac {3}{2} \int \left (\csc \left (c+d x+\frac {\pi }{2}\right ) a+a\right ) \left (8 A a^3+5 (8 A+7 B) \csc \left (c+d x+\frac {\pi }{2}\right ) a^3\right )dx+\frac {(32 A+35 B) \tan (c+d x) \left (a^4 \sec (c+d x)+a^4\right )}{2 d}\right )+\frac {(4 A+7 B) \tan (c+d x) \left (a^2 \sec (c+d x)+a^2\right )^2}{3 d}\right )+\frac {a B \tan (c+d x) (a \sec (c+d x)+a)^3}{4 d}\) |
\(\Big \downarrow \) 4402 |
\(\displaystyle \frac {1}{4} \left (\frac {1}{3} \left (\frac {3}{2} \left (5 a^4 (8 A+7 B) \int \sec ^2(c+d x)dx+a^4 (48 A+35 B) \int \sec (c+d x)dx+8 a^4 A x\right )+\frac {(32 A+35 B) \tan (c+d x) \left (a^4 \sec (c+d x)+a^4\right )}{2 d}\right )+\frac {(4 A+7 B) \tan (c+d x) \left (a^2 \sec (c+d x)+a^2\right )^2}{3 d}\right )+\frac {a B \tan (c+d x) (a \sec (c+d x)+a)^3}{4 d}\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \frac {1}{4} \left (\frac {1}{3} \left (\frac {3}{2} \left (a^4 (48 A+35 B) \int \csc \left (c+d x+\frac {\pi }{2}\right )dx+5 a^4 (8 A+7 B) \int \csc \left (c+d x+\frac {\pi }{2}\right )^2dx+8 a^4 A x\right )+\frac {(32 A+35 B) \tan (c+d x) \left (a^4 \sec (c+d x)+a^4\right )}{2 d}\right )+\frac {(4 A+7 B) \tan (c+d x) \left (a^2 \sec (c+d x)+a^2\right )^2}{3 d}\right )+\frac {a B \tan (c+d x) (a \sec (c+d x)+a)^3}{4 d}\) |
\(\Big \downarrow \) 4254 |
\(\displaystyle \frac {1}{4} \left (\frac {1}{3} \left (\frac {3}{2} \left (-\frac {5 a^4 (8 A+7 B) \int 1d(-\tan (c+d x))}{d}+a^4 (48 A+35 B) \int \csc \left (c+d x+\frac {\pi }{2}\right )dx+8 a^4 A x\right )+\frac {(32 A+35 B) \tan (c+d x) \left (a^4 \sec (c+d x)+a^4\right )}{2 d}\right )+\frac {(4 A+7 B) \tan (c+d x) \left (a^2 \sec (c+d x)+a^2\right )^2}{3 d}\right )+\frac {a B \tan (c+d x) (a \sec (c+d x)+a)^3}{4 d}\) |
\(\Big \downarrow \) 24 |
\(\displaystyle \frac {1}{4} \left (\frac {1}{3} \left (\frac {3}{2} \left (a^4 (48 A+35 B) \int \csc \left (c+d x+\frac {\pi }{2}\right )dx+\frac {5 a^4 (8 A+7 B) \tan (c+d x)}{d}+8 a^4 A x\right )+\frac {(32 A+35 B) \tan (c+d x) \left (a^4 \sec (c+d x)+a^4\right )}{2 d}\right )+\frac {(4 A+7 B) \tan (c+d x) \left (a^2 \sec (c+d x)+a^2\right )^2}{3 d}\right )+\frac {a B \tan (c+d x) (a \sec (c+d x)+a)^3}{4 d}\) |
\(\Big \downarrow \) 4257 |
\(\displaystyle \frac {1}{4} \left (\frac {1}{3} \left (\frac {3}{2} \left (\frac {a^4 (48 A+35 B) \text {arctanh}(\sin (c+d x))}{d}+\frac {5 a^4 (8 A+7 B) \tan (c+d x)}{d}+8 a^4 A x\right )+\frac {(32 A+35 B) \tan (c+d x) \left (a^4 \sec (c+d x)+a^4\right )}{2 d}\right )+\frac {(4 A+7 B) \tan (c+d x) \left (a^2 \sec (c+d x)+a^2\right )^2}{3 d}\right )+\frac {a B \tan (c+d x) (a \sec (c+d x)+a)^3}{4 d}\) |
(a*B*(a + a*Sec[c + d*x])^3*Tan[c + d*x])/(4*d) + (((4*A + 7*B)*(a^2 + a^2 *Sec[c + d*x])^2*Tan[c + d*x])/(3*d) + (((32*A + 35*B)*(a^4 + a^4*Sec[c + d*x])*Tan[c + d*x])/(2*d) + (3*(8*a^4*A*x + (a^4*(48*A + 35*B)*ArcTanh[Sin [c + d*x]])/d + (5*a^4*(8*A + 7*B)*Tan[c + d*x])/d))/2)/3)/4
3.1.74.3.1 Defintions of rubi rules used
Int[(a_)*(Fx_), x_Symbol] :> Simp[a Int[Fx, x], x] /; FreeQ[a, x] && !Ma tchQ[Fx, (b_)*(Gx_) /; FreeQ[b, x]]
Int[csc[(c_.) + (d_.)*(x_)]^(n_), x_Symbol] :> Simp[-d^(-1) Subst[Int[Exp andIntegrand[(1 + x^2)^(n/2 - 1), x], x], x, Cot[c + d*x]], x] /; FreeQ[{c, d}, x] && IGtQ[n/2, 0]
Int[csc[(c_.) + (d_.)*(x_)], x_Symbol] :> Simp[-ArcTanh[Cos[c + d*x]]/d, x] /; FreeQ[{c, d}, x]
Int[(csc[(e_.) + (f_.)*(x_)]*(b_.) + (a_))*(csc[(e_.) + (f_.)*(x_)]*(d_.) + (c_)), x_Symbol] :> Simp[a*c*x, x] + (Simp[b*d Int[Csc[e + f*x]^2, x], x ] + Simp[(b*c + a*d) Int[Csc[e + f*x], x], x]) /; FreeQ[{a, b, c, d, e, f }, x] && NeQ[b*c - a*d, 0] && NeQ[b*c + a*d, 0]
Int[(csc[(e_.) + (f_.)*(x_)]*(b_.) + (a_))^(m_)*(csc[(e_.) + (f_.)*(x_)]*(d _.) + (c_)), x_Symbol] :> Simp[(-b)*d*Cot[e + f*x]*((a + b*Csc[e + f*x])^(m - 1)/(f*m)), x] + Simp[1/m Int[(a + b*Csc[e + f*x])^(m - 1)*Simp[a*c*m + (b*c*m + a*d*(2*m - 1))*Csc[e + f*x], x], x], x] /; FreeQ[{a, b, c, d, e, f}, x] && NeQ[b*c - a*d, 0] && GtQ[m, 1] && EqQ[a^2 - b^2, 0] && IntegerQ[2 *m]
Time = 4.38 (sec) , antiderivative size = 196, normalized size of antiderivative = 1.30
method | result | size |
parts | \(a^{4} A x -\frac {\left (a^{4} A +4 B \,a^{4}\right ) \left (-\frac {2}{3}-\frac {\sec \left (d x +c \right )^{2}}{3}\right ) \tan \left (d x +c \right )}{d}+\frac {\left (4 a^{4} A +B \,a^{4}\right ) \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{d}+\frac {\left (4 a^{4} A +6 B \,a^{4}\right ) \left (\frac {\sec \left (d x +c \right ) \tan \left (d x +c \right )}{2}+\frac {\ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{2}\right )}{d}+\frac {\left (6 a^{4} A +4 B \,a^{4}\right ) \tan \left (d x +c \right )}{d}+\frac {B \,a^{4} \left (-\left (-\frac {\sec \left (d x +c \right )^{3}}{4}-\frac {3 \sec \left (d x +c \right )}{8}\right ) \tan \left (d x +c \right )+\frac {3 \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{8}\right )}{d}\) | \(196\) |
parallelrisch | \(\frac {44 \left (-\frac {18 \left (\frac {3}{4}+\frac {\cos \left (4 d x +4 c \right )}{4}+\cos \left (2 d x +2 c \right )\right ) \left (A +\frac {35 B}{48}\right ) \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )}{11}+\frac {18 \left (\frac {3}{4}+\frac {\cos \left (4 d x +4 c \right )}{4}+\cos \left (2 d x +2 c \right )\right ) \left (A +\frac {35 B}{48}\right ) \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )}{11}+\frac {3 A x d \cos \left (2 d x +2 c \right )}{11}+\frac {3 A x d \cos \left (4 d x +4 c \right )}{44}+\left (A +\frac {14 B}{11}\right ) \sin \left (2 d x +2 c \right )+\frac {3 \left (A +\frac {27 B}{16}\right ) \sin \left (3 d x +3 c \right )}{11}+\frac {5 \left (A +B \right ) \sin \left (4 d x +4 c \right )}{11}+\frac {3 \left (A +\frac {35 B}{16}\right ) \sin \left (d x +c \right )}{11}+\frac {9 A x d}{44}\right ) a^{4}}{3 d \left (\cos \left (4 d x +4 c \right )+4 \cos \left (2 d x +2 c \right )+3\right )}\) | \(207\) |
derivativedivides | \(\frac {-a^{4} A \left (-\frac {2}{3}-\frac {\sec \left (d x +c \right )^{2}}{3}\right ) \tan \left (d x +c \right )+B \,a^{4} \left (-\left (-\frac {\sec \left (d x +c \right )^{3}}{4}-\frac {3 \sec \left (d x +c \right )}{8}\right ) \tan \left (d x +c \right )+\frac {3 \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{8}\right )+4 a^{4} A \left (\frac {\sec \left (d x +c \right ) \tan \left (d x +c \right )}{2}+\frac {\ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{2}\right )-4 B \,a^{4} \left (-\frac {2}{3}-\frac {\sec \left (d x +c \right )^{2}}{3}\right ) \tan \left (d x +c \right )+6 a^{4} A \tan \left (d x +c \right )+6 B \,a^{4} \left (\frac {\sec \left (d x +c \right ) \tan \left (d x +c \right )}{2}+\frac {\ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{2}\right )+4 a^{4} A \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )+4 B \,a^{4} \tan \left (d x +c \right )+a^{4} A \left (d x +c \right )+B \,a^{4} \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{d}\) | \(250\) |
default | \(\frac {-a^{4} A \left (-\frac {2}{3}-\frac {\sec \left (d x +c \right )^{2}}{3}\right ) \tan \left (d x +c \right )+B \,a^{4} \left (-\left (-\frac {\sec \left (d x +c \right )^{3}}{4}-\frac {3 \sec \left (d x +c \right )}{8}\right ) \tan \left (d x +c \right )+\frac {3 \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{8}\right )+4 a^{4} A \left (\frac {\sec \left (d x +c \right ) \tan \left (d x +c \right )}{2}+\frac {\ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{2}\right )-4 B \,a^{4} \left (-\frac {2}{3}-\frac {\sec \left (d x +c \right )^{2}}{3}\right ) \tan \left (d x +c \right )+6 a^{4} A \tan \left (d x +c \right )+6 B \,a^{4} \left (\frac {\sec \left (d x +c \right ) \tan \left (d x +c \right )}{2}+\frac {\ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{2}\right )+4 a^{4} A \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )+4 B \,a^{4} \tan \left (d x +c \right )+a^{4} A \left (d x +c \right )+B \,a^{4} \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{d}\) | \(250\) |
norman | \(\frac {a^{4} A x +a^{4} A x \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{8}-4 a^{4} A x \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}+6 a^{4} A x \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{4}-4 a^{4} A x \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{6}-\frac {5 a^{4} \left (8 A +7 B \right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{7}}{4 d}+\frac {3 a^{4} \left (24 A +31 B \right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{4 d}+\frac {a^{4} \left (424 A +385 B \right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{5}}{12 d}-\frac {a^{4} \left (520 A +511 B \right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{3}}{12 d}}{\left (-1+\tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}\right )^{4}}-\frac {a^{4} \left (48 A +35 B \right ) \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )}{8 d}+\frac {a^{4} \left (48 A +35 B \right ) \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )}{8 d}\) | \(252\) |
risch | \(a^{4} A x -\frac {i a^{4} \left (48 A \,{\mathrm e}^{7 i \left (d x +c \right )}+81 B \,{\mathrm e}^{7 i \left (d x +c \right )}-144 A \,{\mathrm e}^{6 i \left (d x +c \right )}-96 B \,{\mathrm e}^{6 i \left (d x +c \right )}+48 A \,{\mathrm e}^{5 i \left (d x +c \right )}+105 B \,{\mathrm e}^{5 i \left (d x +c \right )}-480 A \,{\mathrm e}^{4 i \left (d x +c \right )}-480 B \,{\mathrm e}^{4 i \left (d x +c \right )}-48 A \,{\mathrm e}^{3 i \left (d x +c \right )}-105 B \,{\mathrm e}^{3 i \left (d x +c \right )}-496 A \,{\mathrm e}^{2 i \left (d x +c \right )}-544 B \,{\mathrm e}^{2 i \left (d x +c \right )}-48 \,{\mathrm e}^{i \left (d x +c \right )} A -81 B \,{\mathrm e}^{i \left (d x +c \right )}-160 A -160 B \right )}{12 d \left ({\mathrm e}^{2 i \left (d x +c \right )}+1\right )^{4}}-\frac {6 a^{4} \ln \left ({\mathrm e}^{i \left (d x +c \right )}-i\right ) A}{d}-\frac {35 a^{4} \ln \left ({\mathrm e}^{i \left (d x +c \right )}-i\right ) B}{8 d}+\frac {6 a^{4} \ln \left ({\mathrm e}^{i \left (d x +c \right )}+i\right ) A}{d}+\frac {35 a^{4} \ln \left ({\mathrm e}^{i \left (d x +c \right )}+i\right ) B}{8 d}\) | \(293\) |
a^4*A*x-(A*a^4+4*B*a^4)/d*(-2/3-1/3*sec(d*x+c)^2)*tan(d*x+c)+(4*A*a^4+B*a^ 4)/d*ln(sec(d*x+c)+tan(d*x+c))+(4*A*a^4+6*B*a^4)/d*(1/2*sec(d*x+c)*tan(d*x +c)+1/2*ln(sec(d*x+c)+tan(d*x+c)))+(6*A*a^4+4*B*a^4)/d*tan(d*x+c)+B*a^4/d* (-(-1/4*sec(d*x+c)^3-3/8*sec(d*x+c))*tan(d*x+c)+3/8*ln(sec(d*x+c)+tan(d*x+ c)))
Time = 0.28 (sec) , antiderivative size = 157, normalized size of antiderivative = 1.04 \[ \int (a+a \sec (c+d x))^4 (A+B \sec (c+d x)) \, dx=\frac {48 \, A a^{4} d x \cos \left (d x + c\right )^{4} + 3 \, {\left (48 \, A + 35 \, B\right )} a^{4} \cos \left (d x + c\right )^{4} \log \left (\sin \left (d x + c\right ) + 1\right ) - 3 \, {\left (48 \, A + 35 \, B\right )} a^{4} \cos \left (d x + c\right )^{4} \log \left (-\sin \left (d x + c\right ) + 1\right ) + 2 \, {\left (160 \, {\left (A + B\right )} a^{4} \cos \left (d x + c\right )^{3} + 3 \, {\left (16 \, A + 27 \, B\right )} a^{4} \cos \left (d x + c\right )^{2} + 8 \, {\left (A + 4 \, B\right )} a^{4} \cos \left (d x + c\right ) + 6 \, B a^{4}\right )} \sin \left (d x + c\right )}{48 \, d \cos \left (d x + c\right )^{4}} \]
1/48*(48*A*a^4*d*x*cos(d*x + c)^4 + 3*(48*A + 35*B)*a^4*cos(d*x + c)^4*log (sin(d*x + c) + 1) - 3*(48*A + 35*B)*a^4*cos(d*x + c)^4*log(-sin(d*x + c) + 1) + 2*(160*(A + B)*a^4*cos(d*x + c)^3 + 3*(16*A + 27*B)*a^4*cos(d*x + c )^2 + 8*(A + 4*B)*a^4*cos(d*x + c) + 6*B*a^4)*sin(d*x + c))/(d*cos(d*x + c )^4)
\[ \int (a+a \sec (c+d x))^4 (A+B \sec (c+d x)) \, dx=a^{4} \left (\int A\, dx + \int 4 A \sec {\left (c + d x \right )}\, dx + \int 6 A \sec ^{2}{\left (c + d x \right )}\, dx + \int 4 A \sec ^{3}{\left (c + d x \right )}\, dx + \int A \sec ^{4}{\left (c + d x \right )}\, dx + \int B \sec {\left (c + d x \right )}\, dx + \int 4 B \sec ^{2}{\left (c + d x \right )}\, dx + \int 6 B \sec ^{3}{\left (c + d x \right )}\, dx + \int 4 B \sec ^{4}{\left (c + d x \right )}\, dx + \int B \sec ^{5}{\left (c + d x \right )}\, dx\right ) \]
a**4*(Integral(A, x) + Integral(4*A*sec(c + d*x), x) + Integral(6*A*sec(c + d*x)**2, x) + Integral(4*A*sec(c + d*x)**3, x) + Integral(A*sec(c + d*x) **4, x) + Integral(B*sec(c + d*x), x) + Integral(4*B*sec(c + d*x)**2, x) + Integral(6*B*sec(c + d*x)**3, x) + Integral(4*B*sec(c + d*x)**4, x) + Int egral(B*sec(c + d*x)**5, x))
Leaf count of result is larger than twice the leaf count of optimal. 293 vs. \(2 (141) = 282\).
Time = 0.22 (sec) , antiderivative size = 293, normalized size of antiderivative = 1.94 \[ \int (a+a \sec (c+d x))^4 (A+B \sec (c+d x)) \, dx=\frac {16 \, {\left (\tan \left (d x + c\right )^{3} + 3 \, \tan \left (d x + c\right )\right )} A a^{4} + 48 \, {\left (d x + c\right )} A a^{4} + 64 \, {\left (\tan \left (d x + c\right )^{3} + 3 \, \tan \left (d x + c\right )\right )} B a^{4} - 3 \, B a^{4} {\left (\frac {2 \, {\left (3 \, \sin \left (d x + c\right )^{3} - 5 \, \sin \left (d x + c\right )\right )}}{\sin \left (d x + c\right )^{4} - 2 \, \sin \left (d x + c\right )^{2} + 1} - 3 \, \log \left (\sin \left (d x + c\right ) + 1\right ) + 3 \, \log \left (\sin \left (d x + c\right ) - 1\right )\right )} - 48 \, A a^{4} {\left (\frac {2 \, \sin \left (d x + c\right )}{\sin \left (d x + c\right )^{2} - 1} - \log \left (\sin \left (d x + c\right ) + 1\right ) + \log \left (\sin \left (d x + c\right ) - 1\right )\right )} - 72 \, B a^{4} {\left (\frac {2 \, \sin \left (d x + c\right )}{\sin \left (d x + c\right )^{2} - 1} - \log \left (\sin \left (d x + c\right ) + 1\right ) + \log \left (\sin \left (d x + c\right ) - 1\right )\right )} + 192 \, A a^{4} \log \left (\sec \left (d x + c\right ) + \tan \left (d x + c\right )\right ) + 48 \, B a^{4} \log \left (\sec \left (d x + c\right ) + \tan \left (d x + c\right )\right ) + 288 \, A a^{4} \tan \left (d x + c\right ) + 192 \, B a^{4} \tan \left (d x + c\right )}{48 \, d} \]
1/48*(16*(tan(d*x + c)^3 + 3*tan(d*x + c))*A*a^4 + 48*(d*x + c)*A*a^4 + 64 *(tan(d*x + c)^3 + 3*tan(d*x + c))*B*a^4 - 3*B*a^4*(2*(3*sin(d*x + c)^3 - 5*sin(d*x + c))/(sin(d*x + c)^4 - 2*sin(d*x + c)^2 + 1) - 3*log(sin(d*x + c) + 1) + 3*log(sin(d*x + c) - 1)) - 48*A*a^4*(2*sin(d*x + c)/(sin(d*x + c )^2 - 1) - log(sin(d*x + c) + 1) + log(sin(d*x + c) - 1)) - 72*B*a^4*(2*si n(d*x + c)/(sin(d*x + c)^2 - 1) - log(sin(d*x + c) + 1) + log(sin(d*x + c) - 1)) + 192*A*a^4*log(sec(d*x + c) + tan(d*x + c)) + 48*B*a^4*log(sec(d*x + c) + tan(d*x + c)) + 288*A*a^4*tan(d*x + c) + 192*B*a^4*tan(d*x + c))/d
Time = 0.34 (sec) , antiderivative size = 223, normalized size of antiderivative = 1.48 \[ \int (a+a \sec (c+d x))^4 (A+B \sec (c+d x)) \, dx=\frac {24 \, {\left (d x + c\right )} A a^{4} + 3 \, {\left (48 \, A a^{4} + 35 \, B a^{4}\right )} \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 1 \right |}\right ) - 3 \, {\left (48 \, A a^{4} + 35 \, B a^{4}\right )} \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 1 \right |}\right ) - \frac {2 \, {\left (120 \, A a^{4} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{7} + 105 \, B a^{4} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{7} - 424 \, A a^{4} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} - 385 \, B a^{4} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} + 520 \, A a^{4} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} + 511 \, B a^{4} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - 216 \, A a^{4} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 279 \, B a^{4} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )\right )}}{{\left (\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - 1\right )}^{4}}}{24 \, d} \]
1/24*(24*(d*x + c)*A*a^4 + 3*(48*A*a^4 + 35*B*a^4)*log(abs(tan(1/2*d*x + 1 /2*c) + 1)) - 3*(48*A*a^4 + 35*B*a^4)*log(abs(tan(1/2*d*x + 1/2*c) - 1)) - 2*(120*A*a^4*tan(1/2*d*x + 1/2*c)^7 + 105*B*a^4*tan(1/2*d*x + 1/2*c)^7 - 424*A*a^4*tan(1/2*d*x + 1/2*c)^5 - 385*B*a^4*tan(1/2*d*x + 1/2*c)^5 + 520* A*a^4*tan(1/2*d*x + 1/2*c)^3 + 511*B*a^4*tan(1/2*d*x + 1/2*c)^3 - 216*A*a^ 4*tan(1/2*d*x + 1/2*c) - 279*B*a^4*tan(1/2*d*x + 1/2*c))/(tan(1/2*d*x + 1/ 2*c)^2 - 1)^4)/d
Time = 13.79 (sec) , antiderivative size = 255, normalized size of antiderivative = 1.69 \[ \int (a+a \sec (c+d x))^4 (A+B \sec (c+d x)) \, dx=\frac {2\,A\,a^4\,\mathrm {atan}\left (\frac {\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )}{d}+\frac {12\,A\,a^4\,\mathrm {atanh}\left (\frac {\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )}{d}+\frac {35\,B\,a^4\,\mathrm {atanh}\left (\frac {\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )}{4\,d}+\frac {20\,A\,a^4\,\sin \left (c+d\,x\right )}{3\,d\,\cos \left (c+d\,x\right )}+\frac {2\,A\,a^4\,\sin \left (c+d\,x\right )}{d\,{\cos \left (c+d\,x\right )}^2}+\frac {A\,a^4\,\sin \left (c+d\,x\right )}{3\,d\,{\cos \left (c+d\,x\right )}^3}+\frac {20\,B\,a^4\,\sin \left (c+d\,x\right )}{3\,d\,\cos \left (c+d\,x\right )}+\frac {27\,B\,a^4\,\sin \left (c+d\,x\right )}{8\,d\,{\cos \left (c+d\,x\right )}^2}+\frac {4\,B\,a^4\,\sin \left (c+d\,x\right )}{3\,d\,{\cos \left (c+d\,x\right )}^3}+\frac {B\,a^4\,\sin \left (c+d\,x\right )}{4\,d\,{\cos \left (c+d\,x\right )}^4} \]
(2*A*a^4*atan(sin(c/2 + (d*x)/2)/cos(c/2 + (d*x)/2)))/d + (12*A*a^4*atanh( sin(c/2 + (d*x)/2)/cos(c/2 + (d*x)/2)))/d + (35*B*a^4*atanh(sin(c/2 + (d*x )/2)/cos(c/2 + (d*x)/2)))/(4*d) + (20*A*a^4*sin(c + d*x))/(3*d*cos(c + d*x )) + (2*A*a^4*sin(c + d*x))/(d*cos(c + d*x)^2) + (A*a^4*sin(c + d*x))/(3*d *cos(c + d*x)^3) + (20*B*a^4*sin(c + d*x))/(3*d*cos(c + d*x)) + (27*B*a^4* sin(c + d*x))/(8*d*cos(c + d*x)^2) + (4*B*a^4*sin(c + d*x))/(3*d*cos(c + d *x)^3) + (B*a^4*sin(c + d*x))/(4*d*cos(c + d*x)^4)